import brightness from '@system.brightness';
export default {
    data: {
        title: 'World'
    },
    getValue(){
        brightness.getValue({
            success: function(data){
                console.log('success get brightness value:' + data.value);
            },
            fail: function(data, code) {
                console.log('get brightness fail, code: ' + code + ', data: ' + data);
            },
        });
    },
   setValue(){
       brightness.setValue({
           value: 100,
           success: function(){
               console.log('handling set brightness success.');
           },
           fail: function(data, code){
               console.log('handling set brightness value fail, code:' + code + ', data: ' + data);
           },
       });
   },
    getMode(){
        brightness.getMode({
            success: function(data){
                console.log('success get mode:' + data.mode);
            },
            fail: function(data, code){
                console.log('handling get mode fail, code:' + code + ', data: ' + data);
            },
        });
    },
    setMode(){
        brightness.setMode({
            mode: 1,
            success: function(){
                console.log('handling set mode success.');
            },
            fail: function(data, code){
                console.log('handling set mode fail, code:' + code + ', data: ' + data);
            },
        });
    },
    setKeepScreenOn(){
        brightness.setKeepScreenOn({
            keepScreenOn: true,
            success: function () {
                console.log('handling set keep screen on success.')
            },
            fail: function (data, code) {
                console.log('handling set keep screen on fail, code:' + code + ', data: ' + data);
            },
        });
    }

}
